<?php

use backend\widgets\Bar;
use backend\grid\CheckboxColumn;
use backend\grid\ActionColumn;
use backend\grid\GridView;
use yii\widgets\Pjax;

/* @var $this yii\web\View */
/* @var $searchModel api\models\search\VipAssignmentSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title                   = 'Vip Assignments';
$this->params['breadcrumbs'][] = "Vip管理";
?>
<div class="row">
    <div class="col-sm-12">
        <div class="ibox">
            <?= $this->render('/widgets/_ibox-title') ?>
            <div class="ibox-content">
                <?= Bar::widget() ?>
                <!--                --><? //=$this->render('_search', ['model' => $searchModel]); ?>
                <?php Pjax::begin(); ?>            <?= GridView::widget([
                    'dataProvider' => $dataProvider,
                    'filterModel'  => $searchModel,
                    'columns'      => [
                        ['class' => CheckboxColumn::className()],

                        'item_name',
                        [
                            'attribute' => 'user_id',
                            'value'     => function ($model) {
                                /** @var \api\models\VipAssignment $model */
                                return $model->user->username;
                            }
                        ],
                        'availability_num',

                        [
                            'class'     => \backend\grid\DateColumn::className(),
                            'attribute' => 'expired_time'
                        ],
                        [
                            'class'     => \backend\grid\DateColumn::className(),
                            'attribute' => 'created_at',
                        ],

                        [
                            'class' => ActionColumn::className(),
//                            'template'=>"{}"
                        ],
                    ],
                ]); ?>
                <?php Pjax::end(); ?>
            </div>
        </div>
    </div>
</div>
